Skip to content

fix: lowercase CleanStringForDNS output for RFC 1123 compliance#228

Merged
carlydf merged 1 commit intotemporalio:mainfrom
aarontsharp:fix/clean-string-for-dns-lowercase
Mar 18, 2026
Merged

fix: lowercase CleanStringForDNS output for RFC 1123 compliance#228
carlydf merged 1 commit intotemporalio:mainfrom
aarontsharp:fix/clean-string-for-dns-lowercase

Conversation

@aarontsharp
Copy link
Copy Markdown
Contributor

@aarontsharp aarontsharp commented Mar 12, 2026

Summary

CleanStringForDNS strips invalid characters but does not lowercase the result. When an image tag contains uppercase characters (e.g. myimage:master--HEAD), ComputeVersionedDeploymentName produces a deployment name that violates RFC 1123 DNS label rules, causing Kubernetes to reject the Deployment.

This adds strings.ToLower() to CleanStringForDNS so deployment names are always valid DNS labels.

Why CleanStringForDNS and not cleanBuildID?

The build ID is also used as a Kubernetes label value and as the Temporal worker build ID. Labels allow uppercase ([a-zA-Z0-9._-]), and Temporal build IDs just need to be ASCII. Lowercasing only in CleanStringForDNS keeps the fix scoped to where DNS compliance is required (resource names) without affecting label values or Temporal version matching.

Kubernetes resource names must conform to RFC 1123 DNS labels, which
require lowercase characters. CleanStringForDNS strips invalid characters
but does not lowercase the result, causing deployment creation to fail
when the image tag contains uppercase characters (e.g. "master--HEAD").

This adds strings.ToLower() to CleanStringForDNS so that
ComputeVersionedDeploymentName always produces valid DNS labels.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 12, 2026

CLA assistant check
All committers have signed the CLA.

@aarontsharp aarontsharp marked this pull request as ready for review March 16, 2026 19:49
@aarontsharp aarontsharp requested review from a team and jlegrone as code owners March 16, 2026 19:49
Copy link
Copy Markdown

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@carlydf carlydf merged commit e2c4fce into temporalio:main Mar 18, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants